package com.awn.weidian.demo.controller;

import java.util.List;

import com.awn.weidian.demo.mapper.IshopCar;
import com.awn.weidian.demo.pojo.Shopcar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;




@RestController
@CrossOrigin
@RequestMapping("/api/")
public class CshaoCar{

	@Autowired
	IshopCar dm;
	/**
	 * ��ʾ
	 * @return
	 */
	@GetMapping("/showall")
	public List<Shopcar> showAll(){
		return dm.showAll();
	}
	/**
	 * ����
	 * @param dept
	 * @return
	 */
	@PostMapping("/add")
	public int addAll(@RequestBody Shopcar dept){
		return dm.addAll(dept);
	}
	

	/**
	 * �޸�
	 * @param dept
	 * @return
	 */
	
	@PostMapping("/update")
	public int updateAll(@RequestBody Shopcar dept){
		return dm.updateAll(dept);
	}
	/**
	 * ɾ��
	 * @param dept
	 * @return
	 */
	
	@PostMapping("/delete")
	public int deleteAll(@RequestBody Shopcar dept){
		return dm.deleteAll(dept);
	}
}
